package com.ruoyi.assemble.common.utils;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

/**
 * @author yuqh
 * @time 2022/7/25 17:13
 * @descrition 功能描述:
 */
public class DtaeRnageUtils {
    /**
     * 得到时间范围之内的所有日期
     *
     * @param begin
     * @param end
     * @return
     */
    public static List<LocalDate> getDateWithRange(LocalDate begin, LocalDate end) {
        List<LocalDate> list = new ArrayList<>();
        LocalDate tem = begin;
        while (!tem.isAfter(end)) {
            list.add(tem);
            tem = tem.plusDays(1);
        }
        return list;
    }

    public static void main(String args[]){
        List<LocalDate> list = getDateWithRange(LocalDate.now().minusDays(10),LocalDate.now());
    }
}
